Skip to content

feat: Windows XP build (xp feature) - #677

Merged
Zel9278 merged 2 commits into
mainfrom
feat/windows-xp
Oct 9, 2026
Merged

Zel9278 merged 2 commits into
mainfrom
feat/windows-xp

Conversation

@kazukazu123123

Copy link
Copy Markdown
Collaborator

内容

  • Windows XP 向けビルド(xp feature)
    • cargo build --release --target i686-pc-windows-msvc --no-default-features --features xp
    • thunk-rs で VC-LTL5 と YY-Thunks をリンク(VC_LTL / YY_THUNKS が無ければ curl と 7z でダウンロード)
    • TLS は rustls(ring、同梱の Mozilla ルート証明書)。XP の SChannel は使えず、ルート証明書も古いため
    • アップデーターは ureq。reqwest の rustls は aws-lc-rs とシステムのルート証明書を使うため
    • release は GUI サブシステムのまま(subsystem_windows)
  • それ以外のビルドは今まで通り native-tls(default の native-tls feature に移動)。xp と同時に有効にするとコンパイルエラー
  • CI で i686-pc-windows-msvc を --no-default-features --features xp でビルドし、リリースにも上げる
  • Windows 10 より前で OS が Windows 0 (2600) になるのを修正。sysinfo がメジャーバージョンを Windows 10 以降にしかない CurrentMajorVersionNumber から読むため。この場合はレジストリの ProductName を使う(例: Microsoft Windows XP (2600))
  • README に XP では i686 版を手動で入れる旨を追記

確認

  • clippy(Windows x86_64 default、i686 xp)、fmt、テスト
  • 依存ツリー: default に rustls / ureq / thunk-rs が無く、Linux / Android の OpenSSL もそのまま。xp に native-tls / openssl / reqwest / aws-lc-rs が無い
  • XP 版 exe: SubsystemVersion 5.01、乱数は advapi32!SystemFunction036、Vista 以降の API の直接インポートなし
  • Linux / macOS / Android のビルドは手元で確認できていないので CI で見る
  • XP 実機での動作は未確認

🤖 Generated with Claude Code

kazukazu123123 and others added 2 commits October 9, 2026 20:22
sysinfo takes the major version of Windows from CurrentMajorVersionNumber,
which only exists since Windows 10, so Windows 8.1, 7 and XP came out as
"Windows 0 (2600)". When that happens, the product name from the registry
is used instead ("Microsoft Windows XP (2600)").

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
`cargo build --release --target i686-pc-windows-msvc --no-default-features
--features xp` builds a binary for Windows XP:
- VC-LTL5 and YY-Thunks are linked through thunk-rs (curl and 7z are
  needed unless VC_LTL and YY_THUNKS point at them)
- TLS goes through rustls with ring and the bundled Mozilla roots, since
  XP has no usable TLS stack and an outdated root store; the updater uses
  ureq, since reqwest's rustls needs aws-lc-rs and the system roots

Other builds keep native-tls, now behind the default native-tls feature.
CI builds the XP binary as i686-pc-windows-msvc.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@Zel9278

Zel9278 commented Oct 9, 2026

Copy link
Copy Markdown
Owner

ありがとうございます。中身は良さそうなのでマージします。気になった点を1つだけ書いておきます(こちらで別の PR で対応します)。

ビルド時のダウンロードが検証されていない

thunk-rs 0.3.5 は VC-LTL5 と YY-Thunks を curl -LOkf でダウンロードしています(src/lib.rs の 156 行目あたり)。

  • -k で TLS の証明書の確認を切っている
  • SHA-256 などのチェックも無い
  • 落としたものはリリースの exe にそのままリンクされる

CI では自分でダウンロードして SHA-256 を確かめ、VC_LTL / YY_THUNKS の環境変数でそのパスを渡す形にします。

あと、#676 で接続にタイムアウトを付けたときに client.rs で TLS のハンドシェイクを native-tls で直接やるようにしているので、そちらに rustls(xp)の経路も足して合わせます。

@Zel9278
Zel9278 merged commit 18c9a19 into main Oct 9, 2026
9 checks passed
@Zel9278
Zel9278 deleted the feat/windows-xp branch October 9, 2026 14:08
@github-actions github-actions Bot mentioned this pull request Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants